.json-diff-container {
  width: 100%;
  height: 100vh;
  background-color: #f5f5f5;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  display: flex;
  flex-direction: column;
}

/* 顶部统计栏 */
.diff-stats {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: opacity 0.2s ease;
}

.stats-item:hover {
  opacity: 0.8;
}

.stats-item.unchecked {
  opacity: 0.5;
}

.stats-item .icon {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  position: relative;
}

/* 添加复选框勾选标记 */
.stats-item.checked .icon::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 3px;
  width: 3px;
  height: 6px;
  border: solid #333;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.stats-item.unchanged .icon {
  background-color: #f5f5f5;
  border: 1px solid #d0d0d0;
}

.stats-item.modified .icon {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
}

.stats-item.added .icon {
  background-color: #d4edda;
  border: 1px solid #00b894;
}

.stats-item.removed .icon {
  background-color: #f8d7da;
  border: 1px solid #e74c3c;
}

.stats-item.moved .icon {
  background-color: #e3f2fd;
  border: 1px solid #2196f3;
}

.toggle-view-btn {
  background: #007acc;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: auto;
}

.toggle-view-btn:hover {
  background: #005a9e;
}

/* 主要内容区域 */
.diff-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边对比模式 */
.side-by-side {
  display: flex;
  width: 100%;
}

.diff-panel {
  flex: 1;
  background: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.diff-panel:last-child {
  border-right: none;
}

.panel-header {
  background: #f8f9fa;
  padding: 10px 16px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.panel-header.old-value {
  background: #fff5f5;
  color: #c53030;
}

.panel-header.new-value {
  background: #f0fff4;
  color: #38a169;
}

.panel-content {
  flex: 1;
  overflow: auto;
  padding: 0;
}

/* 统一视图模式 */
.unified-view {
  width: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.unified-header {
  background: #f8f9fa;
  padding: 10px 16px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.unified-view .panel-content {
  flex: 1;
  overflow: auto;
  padding: 0;
}

/* JSON条目样式 */
.json-line {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  min-height: 32px;
  font-size: 13px;
  line-height: 1.4;
}

.json-line:hover {
  background-color: #f8f9fa;
}

.line-number {
  text-align: right;
  color: #999;
  margin-right: 16px;
  margin-left: 16px;
  font-size: 12px;
  flex-shrink: 0;
}

.line-content {
  flex: 1;
  word-break: break-all;
  display: flex;
  align-items: center;
  margin-right: 16px;
}

.path {
  font-weight: 600;
  color: #0066cc;
  margin-right: 8px;
  margin-left: 4px;
}

.value {
  font-family: 'SF Mono', 'Monaco', monospace;
}

.value.string {
  color: #22863a;
}

.value.number {
  color: #005cc5;
}

.value.boolean {
  color: #e36209;
}

.value.null {
  color: #6f42c1;
}

.value.undefined {
  color: #6a737d;
  font-style: italic;
}

.value.object {
  color: #24292e;
}

/* 值变化显示（旧值→新值） */
.value-change {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'SF Mono', 'Monaco', monospace;
}

.value-change .old-value {
  color: #d32f2f;
  text-decoration: line-through;
  opacity: 0.8;
}

.value-change .new-value {
  color: #388e3c;
  font-weight: 600;
}

.change-arrow {
  color: #666;
  font-weight: 600;
  margin: 0 4px;
  flex-shrink: 0;
}

/* 差异类型背景色 */
.json-line.unchanged {
  background-color: #ffffff;
  border-left: 4px solid #ffffff;
}

.json-line.modified {
  background-color: #fff8e1;
  border-left: 4px solid #ffa726;
}

.json-line.added {
  background-color: #e8f5e8;
  border-left: 4px solid #4caf50;
}

.json-line.removed {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
}

.json-line.moved {
  background-color: #e3f2fd;
  border-left: 4px solid #2196f3;
}

/* 移动指示器 */
.move-indicator {
  background: #2196f3;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 8px;
  white-space: nowrap;
}

/* 差异类型标签 */
.diff-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.diff-type.unchanged {
  /* background: #f5f5f5;
  color: #666; */
}

.diff-type.modified {
  background: #fff3e0;
  color: #e65100;
}

.diff-type.added {
  background: #e8f5e8;
  color: #2e7d32;
}

.diff-type.removed {
  background: #ffebee;
  color: #c62828;
}

.diff-type.moved {
  background: #e3f2fd;
  color: #1565c0;
}

/* 字段容器 - 包含展开按钮和字段名 */
.field-container {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  position: relative;
}

/* 排序选项框 */
.sort-options {
  position: absolute;
  left: 120px;
  top: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 6px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  gap: 8px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1000;
}

.sort-options label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #333;
}

.sort-options input[type="radio"] {
  margin: 0;
}

/* 展开按钮容器 - 固定宽度确保对齐 */
.expand-toggle-container {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 展开/折叠按钮 */
.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #666;
  font-size: 10px;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.expand-toggle:hover {
  color: #333;
}

.expand-toggle.expanded::before {
  content: '▼';
}

.expand-toggle.collapsed::before {
  content: '▶';
}

/* 展开按钮占位符 - 确保没有子元素的行也对齐 */
.expand-toggle-placeholder {
  width: 12px;
  height: 12px;
}

/* 括号样式 */
.bracket {
  color: #666;
  font-weight: 600;
  font-size: 14px;
}

/* 嵌套缩进现在通过动态样式处理 */

/* 滚动条样式 */
.panel-content::-webkit-scrollbar {
  width: 8px;
}

.panel-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.panel-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .side-by-side {
    flex-direction: column;
  }
  
  .diff-panel {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .diff-panel:last-child {
    border-bottom: none;
  }
  
  .diff-stats {
    flex-wrap: wrap;
    gap: 10px;
  }
}
